repo/commit: Split up metadata/content commit paths
authorColin Walters <walters@verbum.org>
Tue, 23 May 2017 20:18:31 +0000 (16:18 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Thu, 1 Jun 2017 18:43:38 +0000 (18:43 +0000)
commitf4f13307896b350676e2b32751fb5e33aa0fb3a9
tree12c5b561c55c4775fdff1da5a737cb06ae369c0c
parentec1964dd4416e255d41d590e08bc247484f1f304
repo/commit: Split up metadata/content commit paths

There was a lot of conditionals inside `write_object()` differentating
between metadata/content, and then for content, on the different repo
types.  Further, in the metadata path since the logic is simpler, can
present a non-streaming API, and further use `OtTmpfile`, etc.

Splitting them up helps drop a lot of conditionals. We introduce a small
`CleanupUnlinkat` that allows us to fully convert to the new code style in both
functions.

This itself is still prep for fully switching to `GLnxTmpfile`.

Closes: #881
Approved by: jlebon
src/libostree/ostree-repo-commit.c